<?
  use_helper("form", "object");
  if (isset($obiect)) { //camp de edit
    $nou = false;
    $id = $obiect->getProdusId();
  }
  else { //camp nou
    $nou = true;
    //$id = 1;
  }
  $baseName = "cerere[produse]".($nou?"[noi]":"")."[$id]";
  $baseId = "cerere_produs".($nou?"Nou":"")."{$id}_";
?>
<tr id="cerere_produs<?=$id?>" class="produs<?=isset($nou)?" nou":""?>">
  <td class="stanga"><h3><?=$id?></h3></td>
<? if ($nou): ?>
  <td><?=input_tag("{$baseName}[nume]", $sf_user->getAttribute("{$baseName}[nume]"), "id={$baseId}nume class=produs-nume")?></td>
  <td><?=input_tag("{$baseName}[standard]", $sf_user->getAttribute("{$baseName}[standard]"), "id={$baseId}standard class=produs-standard")?></td>
  <td><?=input_tag("{$baseName}[cod]", $sf_user->getAttribute("{$baseName}[cod]"), "id={$baseId}cod class=produs-cod")?></td>
  <td><?=input_tag("{$baseName}[material]", $sf_user->getAttribute("{$baseName}[material]"), "id={$baseId}material class=produs-material")?></td>
  <td><?=input_tag("{$baseName}[dimensiune]", $sf_user->getAttribute("{$baseName}[dimensiune]"), "id={$baseId}dimensiune class=produs-dimensiune")?></td>
  <td><?=input_tag("{$baseName}[cantitate]", $sf_user->getAttribute("{$baseName}[cantitate]"), "id={$baseId}cantitate class=produs-cantitate")?></td>
  <td><?=input_tag("{$baseName}[pret_tinta]", $sf_user->getAttribute("{$baseName}[pret_tinta]"), "id={$baseId}pret-tinta class=produs-pret-tinta")?></td>
<? else: ?>
  <td><?=object_input_tag($obiect, 'getNume', "name={$baseName}[nume] id={$baseId}nume class=produs-nume", $sf_user->getAttribute("{$baseName}[nume]"))?></td>
  <td><?=object_input_tag($obiect, 'getStandard', "name={$baseName}[standard] id={$baseId}standard class=produs-standard", $sf_user->getAttribute("{$baseName}[standard]"))?></td>
  <td><?=object_input_tag($obiect, 'getCod', "name={$baseName}[cod] id={$baseId}cod class=produs-cod", $sf_user->getAttribute("{$baseName}[cod]"))?></td>
  <td><?=object_input_tag($obiect, 'getMaterial', "name={$baseName}[material] id={$baseId}material class=produs-material", $sf_user->getAttribute("{$baseName}[material]"))?></td>
  <td><?=object_input_tag($obiect, 'getDimensiune', "name={$baseName}[dimensiune] id={$baseId}dimensiune class=produs-dimensiune", $sf_user->getAttribute("{$baseName}[dimensiune]"))?></td>
  <td><?=object_input_tag($obiect, 'getCantitate', "name={$baseName}[cantitate] id={$baseId}cantitate class=produs-cantitate", $sf_user->getAttribute("{$baseName}[cantitate]"))?></td>
  <td><?=object_input_tag($cerere, 'getCantitate', "name={$baseName}[pret-tinta] id={$baseId}pret-tinta class=produs-pret-tinta", $sf_user->getAttribute("{$baseName}[pret-tinta]"))?></td>
<? endif; ?>
  <td><?=select_tag(
        "{$baseName}[tip_furnizor]", 
        objects_for_select(
          $tipuriFurnizori,
          'getId',
          '__toString',
          $sf_user->getAttribute("{$baseName}[tip_furnizor]")
        ),
        "class='produs-tip-furnizor' id='{$baseId}tip-furnizor'"
      );?></td>
  <td class="operatii-produs">
    <span class="adauga-produs" title="adauga un rand dedesubt">+</span>
    <span class="sterge-produs" title="sterge randul">-</span>
    <span class="goleste-produs" title="goleste randul">x</span>
  </td>
</tr>